
// var ip = 'gl.bringspring.com'
var ip = (window.location.href).match(/\/\/(\S*)\//)[1]  //默认IP
// console.log('window.location.href', window.location.href.match(/\/\/(\S*)\//)[1])
var idx = window.location.href.indexOf(':')
var header = window.location.href.substring(0, idx)
//判断http头
var setIp = (v) => {
  if (v.indexOf("/") != -1) {
    ip = v.match(/(\S*)\//)[1]
    setIp(ip)
  } else {
    return
  }
}
setIp(ip)
window.config = {
  ip: ip,
  allIp: header + '://' + ip,
  VUE_APP_BASE_API: header + '://' + ip + '',
  VUE_APP_BASE_WSS: (idx == 4 ? 'ws' : 'wss') + '://' + ip + '',
  VUE_APP_BASE_URL: header + '://' + ip + ''
}
